package com.xydtech.config;

import com.xydtech.interceptor.EcardAuthenticationInterceptor;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

/**
 *
 * @Title: 拦截器配置
 * @return
 * @exception
 * @author JHON
 * @Date 2021/7/13 14:18
 **/
@Configuration
public class EcardApiInterceptorConfig implements WebMvcConfigurer {
    @Override
    public void addInterceptors(InterceptorRegistry registry) {
        /**拦截EcardApi请求，通过判断是否有 @LoginRequired 注解 决定是否需要登录*/
        registry.addInterceptor(new EcardAuthenticationInterceptor()).addPathPatterns("/ecardSaasApi/**");
    }
}
